using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
using bitzhuwei.Compiler;

namespace bitzhuwei.AnsiCFormat {
    /// <summary>
    /// Correspond to the Vn node jump_statement in the grammar(AnsiC).
    /// </summary>
    internal abstract partial class Vnjump_statement : Vnstatement {
        // [198]=jump_statement : 'goto' 'identifier' ';' ;
        // [199]=jump_statement : 'continue' ';' ;
        // [200]=jump_statement : 'break' ';' ;
        // [201]=jump_statement : 'return' ';' ;
        // [202]=jump_statement : 'return' expression ';' ;

        /// <summary>
        /// [198]=jump_statement : 'goto' 'identifier' ';' ;
        /// </summary>
        public class goto_ : Vnjump_statement {
            private readonly Token r2;
            private readonly Token r1;
            private readonly Token r0;

            /// <summary>
            /// [198]=jump_statement : 'goto' 'identifier' ';' ;
            /// </summary>
            /// <param name="r2"></param>
            /// <param name="r1"></param>
            /// <param name="r0"></param>
            public goto_(Token r2, Token r1, Token r0) {
                this.r2 = r2;
                this.r1 = r1;
                this.r0 = r0;
                this._scope = new TokenRange(r2, r0);
            }


            protected readonly TokenRange _scope;
            public override TokenRange Scope => _scope;

            public override void Format(TextWriter writer, FormatContext context) {
                throw new NotImplementedException();
            }

            public override void FullFormat(BlankConfig preConfig, TextWriter writer, FormatContext context) {
                throw new NotImplementedException();
            }

            public override IEnumerable<string> YieldTokens(TextWriter writer, FormatContext context) {
                throw new NotImplementedException();
            }
        }

        public class cbr_ : Vnjump_statement {
            private readonly Token r1;
            private readonly Token r0;

            /// <summary>
            /// [199]=jump_statement : 'continue' ';' ;
            /// [200]=jump_statement : 'break' ';' ;
            /// [201]=jump_statement : 'return' ';' ;
            /// </summary>
            /// <param name="r1"></param>
            /// <param name="r0"></param>
            public cbr_(Token r1, Token r0) {
                this.r1 = r1;
                this.r0 = r0;
                this._scope = new TokenRange(r1, r0);
            }

            protected readonly TokenRange _scope;
            public override TokenRange Scope => _scope;

            public override void Format(TextWriter writer, FormatContext context) {
                throw new NotImplementedException();
            }

            public override void FullFormat(BlankConfig preConfig, TextWriter writer, FormatContext context) {
                throw new NotImplementedException();
            }

            public override IEnumerable<string> YieldTokens(TextWriter writer, FormatContext context) {
                throw new NotImplementedException();
            }
        }
        /// <summary>
        /// [202]=jump_statement : 'return' expression ';' ;
        /// </summary>
        public class return_ : Vnjump_statement {
            private readonly Token r2;
            private readonly Vnexpression r1;
            private readonly Token r0;

            /// <summary>
            /// [202]=jump_statement : 'return' expression ';' ;
            /// </summary>
            /// <param name="r2"></param>
            /// <param name="r1"></param>
            /// <param name="r0"></param>
            public return_(Token r2, Vnexpression r1, Token r0) {
                this.r2 = r2;
                this.r1 = r1;
                this.r0 = r0;
                this._scope = new TokenRange(r2, r0);
            }


            protected readonly TokenRange _scope;
            public override TokenRange Scope => _scope;

            public override void Format(TextWriter writer, FormatContext context) {
                throw new NotImplementedException();
            }

            public override void FullFormat(BlankConfig preConfig, TextWriter writer, FormatContext context) {
                throw new NotImplementedException();
            }

            public override IEnumerable<string> YieldTokens(TextWriter writer, FormatContext context) {
                throw new NotImplementedException();
            }
        }

    }
}
